package com.chatplus.application.file;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * File 自动配置。
 */
@Configuration
public class FileAutoConfiguration implements WebMvcConfigurer {
    public static final String CONFIG_KEY_ROOT = "chatplus.file";
    @Bean
    @ConfigurationProperties(CONFIG_KEY_ROOT)
    public FileProperties fileProperties() {
        return new FileProperties();
    }

    public static class FileProperties {
        private String active;

        private String localUploadPath;

        private String accessBaseUrl;

        public String getActive() {
            return active;
        }

        public void setActive(String active) {
            this.active = active;
        }

        public String getLocalUploadPath() {
            return localUploadPath;
        }

        public void setLocalUploadPath(String localUploadPath) {
            this.localUploadPath = localUploadPath;
        }

        public String getAccessBaseUrl() {
            return accessBaseUrl;
        }

        public void setAccessBaseUrl(String accessBaseUrl) {
            this.accessBaseUrl = accessBaseUrl;
        }
    }
}
